package com.xpffly.design.visitor.service.impl;

import com.xpffly.design.visitor.service.Element;
import com.xpffly.design.visitor.service.IVisitor;

/**
 * @Author: 午夜学徒
 * @Date: 2022/4/5 10:28
 * @Description：具体元素1
 */
public class Element1 extends Element {
    /**
     * 定义业务处理逻辑
     */
    @Override
    public void doSomething() {
        System.out.println("具体元素1----业务逻辑处理");
    }

    /**
     * 允许哪个访问者访问
     *
     * @param visitor
     */
    @Override
    public void accept(IVisitor visitor) {
        visitor.visit(this);
    }
}
